package wpwork.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.Date;

/**
 * 工作人员作业记录查询参数
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class WorkPersonJobQueryVO {
    // 分页参数
    private Integer page = 1;
    private Integer size = 10;

    // 查询条件
    private String fText;           // 任务标题
    private String fExecutionStatus; // 执行状态
    private String fType;           // 任务类型
    private String fRealName;       // 负责人姓名
    private String fAccount;        // 负责人账号
    private String fTaskNumber;     // 任务编号
    private Date startDate;         // 开始时间范围-开始
    private Date endDate;           // 开始时间范围-结束

    // 自定义setter方法，将空字符串转为null
    public void setFText(String fText) {
        this.fText = (fText == null || fText.trim().isEmpty()) ? null : fText.trim();
    }

    public void setFExecutionStatus(String fExecutionStatus) {
        this.fExecutionStatus = (fExecutionStatus == null || fExecutionStatus.trim().isEmpty()) ? null : fExecutionStatus.trim();
    }

    public void setFType(String fType) {
        this.fType = (fType == null || fType.trim().isEmpty()) ? null : fType.trim();
    }

    public void setFRealName(String fRealName) {
        this.fRealName = (fRealName == null || fRealName.trim().isEmpty()) ? null : fRealName.trim();
    }

    public void setFAccount(String fAccount) {
        this.fAccount = (fAccount == null || fAccount.trim().isEmpty()) ? null : fAccount.trim();
    }

    public void setFTaskNumber(String fTaskNumber) {
        this.fTaskNumber = (fTaskNumber == null || fTaskNumber.trim().isEmpty()) ? null : fTaskNumber.trim();
    }
}